package main
import "fmt"
var g int = 20
var x int = 30
func main(){
    var a, b, c int
    var g int = 10
    a = 10
    b= 20
    c = a + b

    fmt.Printf("结果： a = %d, b = %d and c = %d\n", a, b, c)
    fmt.Printf("结果： g = %d\n", g)

    var x int = 10
    var y int = 20
    var z int = 0

    fmt.Printf("main()函数中 a = %d\n", a)
    z = sum(x, y)
    fmt.Printf("main()函数中 z = %d\n", z)
}

func sum(a, b int)int{
    fmt.Printf("sum() 函数中 a = %d\n", a)
    fmt.Printf("sum()函数中 b = %d\n", b)

    return a + b
}